package com.sf.proxy.custom.dynamic.jdk;

import sun.misc.ProxyGenerator;

import java.io.FileOutputStream;

public class TestMain {
    public static void main(String[] args) {
        try{
            HuangNiuProxy huangNiuProxy = new HuangNiuProxy();
            huangNiuProxy.setObject(new Me());
            Person proxy = huangNiuProxy.getProxy();
            byte[] $proxy0s = ProxyGenerator.generateProxyClass("$proxy0", new Class[]{Person.class});
            FileOutputStream fileOutputStream = new FileOutputStream("d:/$proxy0.class");
            fileOutputStream.write($proxy0s);
            fileOutputStream.flush();
//        proxy.maipiao();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
